const express = require('express')
const jwt = require('jsonwebtoken')

const routers = express.Router()

routers.get('/', (req, res) => {
    res.send('ok')
})

routers.get('/home', (req, res) => {
    if (!req.session['view']) {
        req.session['view'] = 1;
    } else {
        req.session['view']++;
    }
    res.render('index', { name: `<h1 style="color: red">第${req.session["view"]}次请求</h1>` })
})

module.exports = {
    routers
}
